package com.carboy.launch.widgets;

import android.content.Context;
import android.widget.Toast;

/**
 * 自定义Toast工具类,防止用户快速操作导致Dialog多次显示
 */
public class CustomToast {

	private static Toast mToast;

	public static void showToast(Context mContext, String text) {
		if (mToast != null) {
			mToast.setText(text);
		} else {
			mToast = Toast.makeText(mContext, text, Toast.LENGTH_SHORT);
		}
		mToast.show();
	}

	public static void showToast(Context mContext, int resId) {
		showToast(mContext, mContext.getResources().getString(resId));
	}
}
